<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>jQuery基础教程之效果-动画</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <style>
        #main {
            width: 600px;
            height: 400px;
            margin: 0px auto;
            text-align: center;
            position: relative;
        }
        img {
            position: absolute;
            width: 30%;
            height: auto;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            opacity: 0.2;
        }
    </style>
</head>
<body>
<h1>动画</h1>
<hr>


<div id="main">
    <img src="https://img.simoniu.com/beatiful_girl01.jpg" id="girl"/><br>
</div>
<div style="text-align: center">
    <input type="button" value="显示图片动画" id="btn"/>
</div>
<script>
    $(function () {
        $("#btn").click(function(){
            $("#girl").animate({
                    height: '+=75px',
                    width: '+=100px',
                    opacity: '+=0.8'
                },
                4000
            )
        })
    })
</script>
</body>
</html>


